]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar-server: Move method
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 4 Jun 2020 20:11:42 +0000 (22:11 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Fri, 5 Jun 2020 22:56:16 +0000 (22:56 +0000)
We'll need to call it from app_update_views(), so move it up to make
it available to that function without a prior declaration.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1300

src/calendar-server/gnome-shell-calendar-server.c

index 8ee8d3f1c58cad0634c66f694d21c26927736ee9..100b77b36bdaaaa0c3ec399d1a4d1fcccab23db5 100644 (file)
@@ -695,6 +695,28 @@ app_stop_view (App *app,
       g_signal_handlers_disconnect_by_func (view, on_objects_removed, app);
 }
 
+static void
+app_notify_has_calendars (App *app)
+{
+  GVariantBuilder dict_builder;
+
+  g_variant_builder_init (&dict_builder, G_VARIANT_TYPE ("a{sv}"));
+  g_variant_builder_add (&dict_builder, "{sv}", "HasCalendars",
+                         g_variant_new_boolean (app_has_calendars (app)));
+
+  g_dbus_connection_emit_signal (app->connection,
+                                 NULL,
+                                 "/org/gnome/Shell/CalendarServer",
+                                 "org.freedesktop.DBus.Properties",
+                                 "PropertiesChanged",
+                                 g_variant_new ("(sa{sv}as)",
+                                                "org.gnome.Shell.CalendarServer",
+                                                &dict_builder,
+                                                NULL),
+                                 NULL);
+  g_variant_builder_clear (&dict_builder);
+}
+
 static void
 app_update_views (App *app)
 {
@@ -726,28 +748,6 @@ app_update_views (App *app)
   g_slist_free_full (clients, g_object_unref);
 }
 
-static void
-app_notify_has_calendars (App *app)
-{
-  GVariantBuilder dict_builder;
-
-  g_variant_builder_init (&dict_builder, G_VARIANT_TYPE ("a{sv}"));
-  g_variant_builder_add (&dict_builder, "{sv}", "HasCalendars",
-                         g_variant_new_boolean (app_has_calendars (app)));
-
-  g_dbus_connection_emit_signal (g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL),
-                                 NULL,
-                                 "/org/gnome/Shell/CalendarServer",
-                                 "org.freedesktop.DBus.Properties",
-                                 "PropertiesChanged",
-                                 g_variant_new ("(sa{sv}as)",
-                                                "org.gnome.Shell.CalendarServer",
-                                                &dict_builder,
-                                                NULL),
-                                 NULL);
-  g_variant_builder_clear (&dict_builder);
-}
-
 static void
 on_client_appeared_cb (CalendarSources *sources,
                        ECalClient *client,